#ifndef VIEWER_H
#define VIEWER_H

#include <QGLViewer/qglviewer.h>
#include <ode/ode.h>

class Object;

class Viewer : public QGLViewer
{
	Q_OBJECT;
public:
	Viewer(QWidget *parent=NULL);
	~Viewer();

	void handleCollisionBetween(dGeomID o0, dGeomID o1);
protected:
	virtual void init();
	virtual void startAnimation();
	virtual void animate();
	virtual void draw();
private:
	dWorldID         _world;
	dSpaceID         _space;
	dJointGroupID    _contactgroup;
	QVector<Object*> _objects;
	QVector<dGeomID> _planes;
	dReal            _aabb[6];
	QTime            _time;
};

#endif // VIEWER_H
